<?php get_header(); ?>

<?php if (get_option('swt_scroll') == 'Hide') { ?>
<?php { echo ''; } ?>
<?php } else { include(TEMPLATEPATH . '/includes/scroll.php'); } ?>

<div id="mainwrap">
<div id="contentwrap">
<div class="inside">
		<?php if(have_posts()): ?>
		<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
		<?php /* If this is a category archive */ if (is_category()) { ?>
		<h2 class="pagetitle">分类目录归档'<?php single_cat_title(); ?>'</h2>
		<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
		<h2 class="pagetitle">标签归档'<?php single_tag_title(); ?>'</h2>
		<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<h2 class="pagetitle">文档目录 <?php the_time('F jS, Y'); ?></h2>
		<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<h2 class="pagetitle">文档目录 <?php the_time('F, Y'); ?></h2>
		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<h2 class="pagetitle">文档目录 <?php the_time('Y'); ?></h2>
		<?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<h2 class="pagetitle">作者归档</h2>
		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<h2 class="pagetitle">博客归档</h2>
		<?php } ?>
		<?php while (have_posts()) : the_post(); ?>

			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

                <?php if ( function_exists( 'get_the_image' ) ) {
            get_the_image( array( 'custom_key' => array( 'post_thumbnail' ), 'default_size' => 'full', 'image_class' => 'alignleft', 'width' => '200', 'height' => '150' ) ); }
            ?>

				<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
				<div class="entry">
					<?php //the_content(''); ?>
                    <?php truncate_post(300, true); ?>
				</div>

            	<div class="meta">
                <?php the_tags('<span class="tags">', ' ', '</span>'); ?>
                <a class="more-link" href="<?php the_permalink() ?>#more"><img src="<?php bloginfo('template_directory'); ?>/images/more.png" alt="Read More" /></a>
                </div>
			</div>

		<?php endwhile; ?>

		<div class="navigation">
         <div class="alignleft navi">
            <?php next_posts_link(__('Older Entries')) ?>
            <?php previous_posts_link(__('Newer Entries')) ?>
		</div>
		</div>

	<?php endif; ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
